#ifndef __TASK_HPP__
#define __TASK_HPP__

#include <iostream>
#include <string>
#include <functional>
#include "Log.hpp"

typedef std::function<int(int,int)> func_t;

class Task
{
public:
    Task(int x,int y,func_t fun=[](int a,int b){return a+b;})
        :_x(x)
        ,_y(y)
        ,_fun(fun)
    {}

    Task()=default;

    void operator()(std::string name)
    {
        logMessage(NORMAL,"%d+%d=%d [%s]",_x,_y,_fun(_x,_y),name.c_str());
    }

private:
    int _x;
    int _y;
    func_t _fun;
};

#endif